package com.huahua.api.entity.enums;

/**
 * @author Huahua-Ai
 * @date 2025-01-10 14:35:00
 * @description TTS任务状态枚举
 */
public enum TtsStatus {

    PENDING("PENDING", "待开始"),
    PROCESSING("PROCESSING", "执行中"),
    COMPLETED("COMPLETED", "已完成"),
    FAILED("FAILED", "失败");

    private final String code;
    private final String description;

    TtsStatus(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public static TtsStatus fromCode(String code) {
        for (TtsStatus status : values()) {
            if (status.code.equals(code)) {
                return status;
            }
        }
        throw new IllegalArgumentException("Unknown TTS status code: " + code);
    }
}
